package com.woniu.cq.medical.controller;


import com.woniu.cq.medical.common.PageResult;
import com.woniu.cq.medical.common.Result;
import com.woniu.cq.medical.entity.AdministrativeWorkloadAccount;
import com.woniu.cq.medical.service.AdministrativeWorkloadAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Lucas
 * @since 2020-09-09
 */
@RestController
@RequestMapping("/medical/administrative-workload-account")
public class AdministrativeWorkloadAccountController {
    @Autowired
    private AdministrativeWorkloadAccountService administrativeWorkloadAccountService;
    @GetMapping("realTimeData")
    public Result getRealTimeData(){
        List<AdministrativeWorkloadAccount> list=administrativeWorkloadAccountService.getRealTimeData();
        return Result.success(list);
    }
    @GetMapping("pageQuery")
    public PageResult getPage(@RequestParam(defaultValue = "1")int pageIndex, @RequestParam(defaultValue = "15")int pageSize,
                              String administrativeName, Date attendanceDateBefore, Date attendanceDateAfter){
        PageResult pageResult = administrativeWorkloadAccountService.pageQuery(pageIndex, pageSize, administrativeName, attendanceDateBefore, attendanceDateAfter);
        return pageResult;
    }
}

